const tools = {
    E:{
        msg:{},
        on(type, cb){
            if(this.msg[type]){
                this.msg[type].push(cb);
            }else{
                this.msg[type] = [cb];
            }
        },
        emit(type){
            if(!this.msg[type]) return;
            const arg = [...arguments].slice(1);
            this.msg[type].forEach(val=>{
                val(...arg);
            })
        }
    }
}